package com.blacksheep.mtm.service;

import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.blacksheep.mtm.dto.MemberDto;
import com.blacksheep.mtm.pojo.common.DataTablesResult;
import com.blacksheep.mtm.pojo.manager.TbMember;
import com.blacksheep.mtm.pojo.manager.TbOrder;

import java.util.List;

/**
 * @author   Z
 * @date 2017/8/11
 */
public interface MemberService {

    /**
     * 根据ID获取会员信息
     * @param memberId
     * @return
     */
    TbMember getMemberById(long memberId);

    /**
     * 分页获得会员列表
     * @param draw
     * @param start
     * @param length
     * @param search
     * @return
     */
    DataTablesResult getMemberList(int draw, int start, int length, String search,int[] state,
                                   String minDate, String maxDate, String orderCol, String orderDir);


    /**
     * 分页获得配送员列表
     * @param draw
     * @param start
     * @param length
     * @param search
     * @return
     */
    DataTablesResult getDispatcherMemberList(int role,int draw, int start, int length, String search,int[] state,
                                   String minDate, String maxDate, String orderCol, String orderDir);




    /**
     * 通过手机获取
     * @param phone
     * @return
     */
    TbMember getMemberByPhone(String phone);

    /**
     * 通过获取名获取
     * @param username
     * @return
     */
    TbMember getMemberByUsername(String username);

    /**
     * 添加会员
     * @param memberDto
     * @return
     */
    TbMember addMember(MemberDto memberDto);

    /**
     * 更新会员信息
     * @param id
     * @param memberDto
     * @return
     */
    TbMember updateMember(Long id,MemberDto memberDto);



    /**
     * 修改会员状态
     * @param id
     * @param state
     * @return
     */
    TbMember alertMemberState(Long id,Integer state);


    /**
     * 验证编辑手机是否存在
     * @param id
     * @param phone
     * @return
     */
    TbMember getMemberByEditPhone(Long id,String phone);

    /**
     * 验证编辑用户名是否存在
     * @param id
     * @param username
     * @return
     */
    TbMember getMemberByEditUsername(Long id,String username);

    DataTablesResult chooseMemberList(int draw,int start,int length,int[] state,String seach,String orderColumn,String orderDir);

    Integer deletBatch(Long[] ids);
}
